#pragma once
#include "Common.h"
#include "PageCache.h"

class CentralCache {
private:
	SpanList _span_lists[NFREELIST];
	static CentralCache _sInst;
private:
	CentralCache(){}
	CentralCache(const CentralCache&) = delete;
	CentralCache& operator=(const CentralCache&) = delete;
public:
	static CentralCache* GetInst() {
		return &_sInst;
	}
	Span* GetOneSpan(SpanList&, size_t);
	size_t FetchRangeObj(void*&, void*&, size_t, size_t);
	void ReleaseListToSpans(void*, size_t);
};